function ajax1(url, cb) {
    const xhr = new XMLHttpRequest;
    xhr.open("get", url, true)

    if (xhr.status === 200 && xhr.readyState == 4) {
        cb(xhr.responseText)
        console.log(11111)
    }
    xhr.send();
}

function ajax1Promise(url) {
    return new Promise(resolve => {
        const xhr = new XMLHttpRequest();
        xhr.open("get", url, true)
        xhr.onload = function () {
            if (xhr.status === 200) {
                resolve(xhr.responseText)
            }
            else console.log("err");

        }
        xhr.send();
    })
}


